package com.czxy.mapper;

import com.czxy.pojo.Address;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author 张青卯
 */
@org.apache.ibatis.annotations.Mapper
public interface AddressMapper extends Mapper<Address> {

    /**
     * findAll 根据用户ID查找出该用户的地址
     * @param userId 用户Id
     * @return List<Address>
     */
    @Select("SELECT * FROM tb_address WHERE user_id = #{userId}")
    List<Address> findAll(@Param("userId") Integer userId);

}
